ti: k3: common: Enable interrupts before entering standby state
authorAndrew F. Davis <[email protected]>
Mon, 25 Jun 2018 17:36:25 +0000 (12:36 -0500)
committerAndrew F. Davis <[email protected]>
Fri, 29 Jun 2018 21:49:21 +0000 (16:49 -0500)
To wake a core from wfi interrupts must be enabled, in some cases they
may not be and so we can lock up here. Unconditionally enable interrupts
before wfi and then restore interrupt state.

Signed-off-by: Andrew F. Davis <[email protected]>
plat/ti/k3/common/k3_psci.c

index 91602c8c198f615264fa7de7982fc6841cf8e04a..4d6428b5c61903b9211ec04c0af1abb476de565c 100644 (file)
@@ -17,12 +17,18 @@ uintptr_t k3_sec_entrypoint;
 
 static void k3_cpu_standby(plat_local_state_t cpu_state)
 {
-       /*
-        * Enter standby state
-        * dsb is good practice before using wfi to enter low power states
-        */
+       unsigned int scr;
+
+       scr = read_scr_el3();
+       /* Enable the Non secure interrupt to wake the CPU */
+       write_scr_el3(scr | SCR_IRQ_BIT | SCR_FIQ_BIT);
+       isb();
+       /* dsb is good practice before using wfi to enter low power states */
        dsb();
+       /* Enter standby state */
        wfi();
+       /* Restore SCR */
+       write_scr_el3(scr);
 }
 
 static int k3_pwr_domain_on(u_register_t mpidr)